package cn.webrx;

import java.io.FileReader;

public class Rwer1 {
    public static void main(String[] args) {
        //字符流
        //Reader  BufferedReader FileReader
        //Writer  BufferedWriter FileWriter
        //try (var writer = new FileWriter("u.txt",true)) {
        //    writer.write("java\r\n");
        //    writer.write("java 中文效果\r\n");
        //    writer.write("java 中文效果\r\n");
        //} catch (Exception e) {
        //
        //}

        try (var reader = new FileReader("u.txt")) {
            while (reader.ready()) {
                System.out.printf("%c",reader.read());
            }
        } catch (Exception e) {

        }
        int zh = '中';
        System.out.printf("%c%c%c%n",97,'b',zh);


        try{
            FileReader reader = new FileReader("u.txt");
            char[] cs = new char[6];
            reader.skip(6);
            reader.read(cs);
            System.out.println(new String(cs));
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
